package com.usf.jprovider.schema.provider.pointer.dynamic;

import com.usf.jprovider.exception.FieldNotFoundException;
import com.usf.jprovider.object.JObjectNode;
import com.usf.jprovider.object.type.JType;

public final class GlobalPointer extends AbstractDynamicPointer {
	
	public GlobalPointer() {
		super();
	}
	public GlobalPointer(String field) {
		super(field);
	}
	
	@Override
	protected JType<?> pointedValue(JObjectNode node) throws FieldNotFoundException {
		return node.getRoot().childPath(field).getValue();
	}
	@Override
	public JObjectNode pointedNode(JObjectNode node) throws FieldNotFoundException {
		return node.getRoot().childPath(field);
	}

}
